/*!
 * \file ExecutionPlan.cpp
 * \brief Implements an ExecutionPlan class as plan to execute after parsing the
 *        arguments
 *
 * This file contains the definition for the CLAP :: ExecutionPlan Class. This
 * is a class to generate an execution plan given inputs and a set of options
 * and subcommands available.
 */

#include "ExecutionPlan.h"

using namespace libCLAP;
using namespace libCLAP :: CLAP;

ExecutionPlan :: ExecutionPlan ( const Common :: String & name )
{
   _Stages.push_back ( name );
}

ExecutionPlan :: ExecutionPlan ( const ExecutionPlan & copy ) :
   _Stages ( copy._Stages )
{
}

ExecutionPlan :: ~ExecutionPlan ( void ) throw ()
{
}

void ExecutionPlan :: AddStage ( const Stage & addition )
{
   _Stages.push_back ( addition );
}

ExecutionPlan & ExecutionPlan :: operator = ( const ExecutionPlan & assign )
{
   _Stages = assign._Stages;
   return ( *this );
}

bool ExecutionPlan :: operator == ( const ExecutionPlan & compare ) const
{
   if ( _Stages == compare._Stages )
   {
      return true;
   }
   else
   {
      return false;
   }
}

bool ExecutionPlan :: operator != ( const ExecutionPlan & compare ) const
{
   if ( _Stages != compare._Stages )
   {
      return true;
   }
   else
   {
      return false;
   }
}

bool ExecutionPlan :: operator < ( const ExecutionPlan & compare ) const
{
   if ( _Stages < compare._Stages )
   {
      return true;
   }
   else
   {
      return false;
   }
}

bool ExecutionPlan :: operator > ( const ExecutionPlan & compare ) const
{
   if ( _Stages > compare._Stages )
   {
      return true;
   }
   else
   {
      return false;
   }
}

ExecutionPlan :: Iterator ExecutionPlan :: End ( void )
{
   return ( _Stages.end ());
}

ExecutionPlan :: Iterator ExecutionPlan :: Begin ( void )
{
   return ( _Stages.begin ());
}

ExecutionPlan :: ConstIterator ExecutionPlan :: End ( void ) const
{
   return ( _Stages.end ());
}

ExecutionPlan :: ConstIterator ExecutionPlan :: Begin ( void ) const
{
   return ( _Stages.begin ());
}

ExecutionPlan :: ReverseIterator ExecutionPlan :: ReverseEnd ( void )
{
   return ( _Stages.rend ());
}

ExecutionPlan :: ReverseIterator ExecutionPlan :: ReverseBegin ( void )
{
   return ( _Stages.rbegin ());
}

ExecutionPlan :: ConstReverseIterator ExecutionPlan :: ReverseEnd ( void ) const
{
   return ( _Stages.rend ());
}

ExecutionPlan :: ConstReverseIterator ExecutionPlan :: ReverseBegin ( void ) const
{
   return ( _Stages.rbegin ());
}
